CKEDITOR.plugins.add('popupimage', {
	init : function(editor) {
		// Plugin logic goes here...
		editor.ui.addButton('Popupimage', {
			label : 'Chèn hình vào editor',
			command : 'addImage',
			icon : this.path + 'images/icon.png'
		});

		editor.addCommand('addImage', {
			exec : function(editor) {
				jQuery.fancybox.open({
					href : '/admin/media/popup-image',
					type : 'iframe',
					padding : 0,
					width:'800px',
					height:'520px',
					openEffect : 'elastic',
					openSpeed  : 50,
					closeEffect : 'none',
					closeSpeed  : 50,
					fitToView   : false,
					autoSize    : false					
				});				
			}
		});

	},

});